package com.middlegroup.pay.service.impl;

import com.middlegroup.pay.entity.Subject;
import com.middlegroup.pay.mapper.SubjectMapper;
import com.middlegroup.pay.service.SubjectService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 主体表 服务实现类
 * </p>
 *
 * @author pc123
 * @since 2019-01-04
 */
@Service
public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> implements SubjectService {

    @Resource
    private SubjectMapper subjectMapper;

    @Override
    @Cacheable(value = "pay_platform",key = "'subject'+#p0.toString()",unless = "#result eq null")
    public Subject getSubjectByCode(String code) {
        return subjectMapper.getSubjectByCode(code);
    }
}
